package org.mca.mcaweb.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

import org.mca.mcaweb.dao.DAO;
import org.mca.mcaweb.entity.Empr;


@Named
@ViewScoped
public class EmprBean implements Serializable {

	private static final long serialVersionUID = -2214346564802268094L;

	private Empr empr = new Empr();

	private List<Empr> emprs = new ArrayList<Empr>(0);
	
//	private ResourceBundle bundle = ResourceBundleUtil.getResourceBunde();
	
	@Inject
	private DAO<Empr> dao;

	public void clear() {
		this.empr = new Empr();
	}
	
	public List<Empr> getTodasEmpresas() {
		if (this.emprs == null){
			this.emprs = dao.listAll();
		}
		return this.emprs;
	}

	public Empr getEmpr() {
		return empr;
	}

	public void setEmpr(Empr empr) {
		this.empr = empr;
	}

	public List<Empr> getEmprs() {
		return emprs;
	}

	public void setEmprs(List<Empr> emprs) {
		this.emprs = emprs;
	}
}